﻿using System.Collections.Generic;
using System.Windows.Forms;

namespace SinaImgUpload.UserView.ViewHelper
{
    internal class GroupBoxHelper
    {
        public static List<string> ModeList = new List<string>() { "普通模式", "P站增强", "配置文件" };

        public void AutoReplace(GroupBox groupBox1, string SelectMode)
        {
            //"","","","","","","",""
            switch (SelectMode)
            {
                case "主界面":

                    Replace(groupBox1, new UserControl());
                    break;

                case "普通模式":

                    Replace(groupBox1, new UserView.OrdinaeyControl());
                    break;

                case "P站增强":

                    Replace(groupBox1, new UserView.EnhanceControl());
                    break;

                case "配置文件":

                    Replace(groupBox1, new UserView.ConfigurationControl());
                    break;
            }
        }

        /// <summary>
        /// GroupBox替换操作
        /// </summary>
        /// <param name="groupBox1"></param>
        /// <param name="Control"></param>
        internal void Replace(GroupBox groupBox1, UserControl Control)
        {
            groupBox1.Controls.Clear();
            groupBox1.Controls.Add(Control);
        }
    }
}